package dxn.nl.file.biz.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import dxn.boot.common.entity.CsColumnDto;
import dxn.nl.file.biz.ApoModeAuthTypeEnum;
import dxn.nl.file.biz.hander.ColumnTypeHandler;
import dxn.nl.file.client.model.enums.ExportFileTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper=false)
@TableName("app_mode")
public class AppModelPo {
    private Long id;

    @Schema(title = "appId")
    private String appId;

    @Schema(title = "模块编号")
    private String modeCode;
    @Schema(title = "模块名称")
    private String modeName;

    @Schema(title = "导出类型 10 导出 20 上传")
    private Integer typeCode;

    @Schema(title = "线程数")
    private Integer threadCount;
    @Schema(title = "导出类型")
    public String getTypeName()
    {
        return ExportFileTypeEnum.getName(typeCode);
    }

    @Schema(title = "权限控制类型 0 无控制 1 网点 2用户")
    private Integer authTypeCode;

    @Schema(title = "导出类型")
    public String getAuthTypeName()
    {
        return ApoModeAuthTypeEnum.getName(authTypeCode);
    }

    @Schema(title = "tag")
    private String tag;

    @Schema(title = "备注")
    private String remark;

    @Schema(title = "创建时间")
    private LocalDateTime createTime;

    @Schema(title = "创建用户")
    private String createUserCode;

    @Schema(title = "创建用户名称")
    private String createUserName;

    @Schema(title = "修改时间")
    private LocalDateTime updateTime;

    @Schema(title = "修改用户编号")
    private String updateUserCode;

    @Schema(title = "修改用户名称")
    private String updateUserName;

    @Schema(title = "模板地址")
    private String templateUrl;

    @Schema(title = "表头信息")
    @TableField(typeHandler = ColumnTypeHandler.class)
    private List<CsColumnDto> columnList;
}
